import random

randNum = random.randint(0, 100)
times = 0
print(randNum)

while True:
    num = int(input('在我心中有个数，1-100，请你猜一猜：'))
    times += 1
    if num > randNum:
        print('大了')
    elif num < randNum:
        print('小了')
    else:
        print('猜对了')
        break

print('猜的次数有点多啊，长点心吧。一共猜了%d次' % times)